<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			//元素是唯一
			const set = new Set();
			//-------------增-------------------------------------
			set.add("zhangsan");
			set.add("lisi");
			set.add("wangwu");
			set.add("zhaoliu");
			set.add("zhangsan");
			// console.log(set);
			//-------------删-------------------------------------
			// set.delete("zhaoliu");
			// set.clear();//清空

			//-------------查-------------------------------------
			// console.log(set.size);

			// console.log(set.has("zhangsan"));

			//-------------遍历-------------------------------------
			for (let s of set) {
				// console.log(s);
			}
			// console.log(set);

			//-------------数组转Set-------------------------------------
			const arr = [1, 2, 3, 3];
			const set2 = new Set(arr);
			// console.log(set2);

			//-------------Set转数组-------------------------------------
			const arr2 = [...set2];
			console.log(arr2);
		</script>
	</head>
	<body>
	</body>
</html>
